﻿@page
@model FangChanCrm.Views.KeHu.DetailModel
@{
}
<!-- customer-details CSS -->
<link rel="stylesheet" href="~/GoTRI/css/mobiscroll.custom.min.css">
<link rel="stylesheet" href="~/GoTRI/css/customer-details.css?v=3">
<link rel="stylesheet" href="~/GoTRI/css/tel-note.css">
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="~/GoTRI/js/jquery-3.2.1.min.js"></script>
<script src="~/GoTRI/js/popper.min.js"></script>
<div class="page-container" id="admui-pageContent">
    <div class="page animation-fade page-forms">
        <div class="page-content" style="padding-bottom: 0px">
            <div class="panel">
                <div class="page-header">
                    <h1 class="page-title">客户详细</h1>
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item">
                            <a class="icon wb-home" href="javascript:;">客户管理</a>
                        </li>
                        <li class="breadcrumb-item active">客户详细</li>
                    </ol>
                </div>
                <div class="tab-pane animation-fade active" id="my_contacts" role="tabpanel">
                    <ul class="list-group">
                        <div id="div_kehu">
                            <li class="list-group-item">
                                <div class="media">
                                    <div class="pr-0 pr-sm-20 align-self-center">
                                        <div class="avatar avatar-online"><img src="/admui-13945148017-1592211513218/public/images/avatar.svg" alt="..."><i></i></div>
                                    </div>
                                    <div class="media-body align-self-center">
                                        <h4 class="mt-0 mb-10">
                                            @ViewBag.KeHu.KeHuXingMing

                                        </h4>
                                        <p>
                                            <i class="icon icon-color wb-map" aria-hidden="true"></i>@ViewBag.KeHu.JuZhuDiZhi
                                            <i class="icon icon-color wb-mobile" style="padding-left:30px;" aria-hidden="true"></i>@ViewBag.KeHu.ShouJiHaoMa
                                        </p>
                                    </div>
                                    <div class="media-right">
                                    </div>
                                </div>
                            </li>
                        </div>
                    </ul>
                    <div>
                        <div id="myPage" class="demo"></div>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-6">
                <div class="page-content" style="padding-top: 0px;padding-right:0px">
                    <div class="panel">
                        <div class="page-header">
                            <h1 class="page-title">客户详细</h1>
                        </div>
                        <div class="tab-pane animation-fade active" id="my_contacts" role="tabpanel">
                            <div id="baseinfo" class="tab-pane active">
                                <div class="user-tel">
                                    <span>客户意户型<span class="red">*</span></span>@ViewBag.KeHu.YiXiangHuXing
                                    <input type="text" id="txt_ShouJiHaoMa">
                                </div>
                                <div class="user-name">
                                    <span>意向单价<span class="red">*</span></span>@ViewBag.KeHu.YiXiangDanJia
                                    <input type="text" id="txt_KeHuXingMing">
                                </div>
                                <div class="user-name">
                                    <span>意向总价<span class="red">*</span></span>@ViewBag.KeHu.YiXiangZongJia
                                    <input type="text" id="txt_KeHuXingMing">
                                </div>
                                <div class="remarks">
                                    <span>客户备注</span>
                                    <span>
                                        上次备注：
                                        <span><label id="lbl_ShangCiGenJin"></label></span>
                                    </span>
                                </div>
                                <textarea name="beihzu" id="txt_BeiZhu" cols="35" rows="3" placeholder="备注内容">@ViewBag.KeHu.KeHuBeiZhu</textarea>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="page-content" style="padding-top: 0px;padding-right: 0px">
                    <div class="panel">
                        <div class="page-header">
                            <h1 class="page-title">跟进详细</h1>
                        </div>
                        <div class="tab-pane animation-fade active" id="my_contacts" role="tabpanel">
                            <div id="custrack" class="tab-pane">
                                <div class="track-top">
                                    <div>
                                        <span>推荐成功</span>
                                        <span>已到访</span>
                                        <span>已成交</span>
                                    </div>
                                    <div>
                                        <div>
                                            <div class="circle actived">
                                                <div></div>
                                            </div>
                                        </div>
                                        <div class="line" id="line_DaoFang"></div>
                                        <div>
                                            <div class="circle" id="yuan_DaoFang">
                                                <div></div>
                                            </div>
                                        </div>
                                        <div class="line" id="line_GouMai"></div>
                                        <div>
                                            <div class="circle" id="yuan_GouMai">
                                                <div></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="track-body">
                                    <div class="body-right" id="div_XiaoShouJiLu">
                                        @for (int i = 0; i < ViewBag.XiaoShouXiangXi.Count; i++)
                                        {
                                            var daofang = false;
                                            var yigoumai = false;
                                            for (var j = 0; j < ViewBag.XiaoShouXiangXi.Count; j++)
                                            {

                                                if (ViewBag.XiaoShouXiangXi[i].XiaoShouDongZuo == "已认购" && yigoumai == false)
                                                {
                                                    yigoumai = true;
                                                }
                                                if (ViewBag.XiaoShouXiangXi[i].XiaoShouDongZuo == "到访" && daofang == false)
                                                {
                                                    daofang = true;
                                                }
                                            }
                                            @if (daofang == true)
                                            {
                                                <button type="button" id="liull1" hidden="hidden" onclick="diaoyong(1)"></button>
                                            }
                                            else
                                            {
                                                <button type="button" id="liull1" hidden="hidden" onclick="diaoyong(0)"></button>
                                            }
                                            @if (yigoumai == true)
                                            {
                                                <button type="button" id="liull2" hidden="hidden" onclick="diaoyong(2)"></button>
                                            }
                                            else
                                            {
                                                <button type="button" id="liull1" hidden="hidden" onclick="diaoyong(0)"></button>
                                            }

                                            <div class="right-item"><div class="item-tit"><div class="tit-left"><div><div class="circle actived"><div></div></div></div><span>@ViewBag.XiaoShouXiangXi[i].XiaoShouDongZuo</span></div><span>@ViewBag.XiaoShouXiangXi[i].CaoZuoShiJian</span></div><div class="tit-body"><div class="item-content"></div><div class="item-foot"><span>操作人</span>-<span>@ViewBag.XiaoShouXiangXi[i].t_RenYuanBiao_CaoZuoRen.XingMing</span>(<span>18000000000</span>)</div></div></div>
                                        }
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="col-md-6">
                <div class="page-content" style="padding-top: 0px;padding-right:0px">
                    <div class="panel">
                        <div class="page-header">
                            <h1 class="page-title">已购房源</h1>
                        </div>
                        <div class="tab-pane animation-fade active" id="my_contacts" role="tabpanel">
                            <div id="baseinfo" class="tab-pane active">

                            </div>
                        </div>
                        </div>
                    </div>
                </div>
            </div>


        </div>
    </div>
</div>
<script>
    $(document).ready(function () {
        chushifangfa();
        $("#SpanKeHu").click();
        document.getElementById("liull1").click();
        document.getElementById("liull2").click();
    });

    function chushifangfa() {
        var shu = getQuery("Id");
        $.ajax({
            url: "../KeHu/ChuShiFangFaShu",
            data: {shu : shu},
            type: "post",
            dataType: "text",
            success: function (response) {
                $("#baseinfo").html(response);
            }
        });
    }

    function getQuery(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return decodeURI(r[2]); return null;
    }


    function diaoyong(panduan) {
        if (panduan == 1) {
            $("#line_DaoFang").attr("class", "line actived");
            $("#yuan_DaoFang").attr("class", "circle actived");
        } else if (panduan == 2) {
            $("#line_GouMai").attr("class", "line actived");
            $("#yuan_GouMai").attr("class", "circle actived");
        }
    }
</script>

